import React from 'react';
import { Tour as AntdTour } from 'antd';
import type { TourProps as AntdTourProps } from 'antd';
import { createStyles } from 'antd-style';

export interface TourProps extends Omit<AntdTourProps, 'className'> {
  /**
   * @description 自定义样式类名
   */
  customClassName?: string;
  /**
   * @description 组件类名
   */
  className?: string;
}

const useStyles = createStyles(({ token, css }) => ({
  tour: css`
    z-index: ${token.zIndexPopupBase};
  `,
}));

const TourComponent: React.FC<TourProps> = ({ customClassName, className, ...restProps }) => {
  const { styles, cx } = useStyles();
  
  const tourClassName = cx(
    className,
    customClassName,
    styles.tour
  );

  return <AntdTour rootClassName={tourClassName} {...restProps} />;
};

const Tour = Object.assign(TourComponent, {
  _InternalPanelDoNotUseOrYouWillBeFired: (AntdTour as any)._InternalPanelDoNotUseOrYouWillBeFired,
});

export { Tour };
export default Tour;

